package service;

import dao.AdminProductsDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pojo.Products;

import java.util.List;

@Service("adminProductsService")
@Transactional
public class AdminProductsService {
    @Autowired
    private AdminProductsDao adminProductsDao;
    public int aP(Products products){return adminProductsDao.addProducts(products);}
    public int dP(Integer pid){return adminProductsDao.deleteProducts(pid);}
    public List<Products> sAP(){return adminProductsDao.selectAllProducts();}
    public int uP(Products products){return adminProductsDao.updateProducts(products);}
    public List<Products> sOP(Integer pid){return adminProductsDao.selectOneProduct(pid);}
}
